/*
 * To Do List:
 * is marked? 
 * who marked?
 * is there a submarine
 * 
 */
package model;

/**
 *
 * @author Karnit Genchay
 */
public class Square {

    private char val;
    private  boolean submarine;
    private static final char EMPTY = '*';
    private static final char WITH_SUBMARINE = 'O'; 
    private static final char BOMBED = 'X';
    private static final char MARKED = 'V'; 
    private int row;

    public int getCol() {
        return col;
    }

    public int getRow() {
        return row;
    }
    private int col;
  public   Square(int row, int col){
 val =EMPTY;
 submarine =  false;
 this.row = row;
 this.col = col;
  }
public boolean isHaveSubmarine () { 
    return submarine;
}
public void print() {  System.out.print(val+"\t" );}
public void setVal(char value){
    val = value;
}
public void setSubmarine() {       submarine=true;}
public void unSetSubmarine() {       submarine=false;}
public void printWithSubmarines(){
    if (submarine&&(val!=BOMBED))
        System.out.print(WITH_SUBMARINE+"\t" );
    else
        print();
}
public void printWithMarks(boolean mark){
    if (mark){
        System.out.print(MARKED+"\t" );}
    else
        print();
}
public char getVal(){ return val;}
    @Override
    public String toString(){
        return val+"    " ;
}
    
public boolean isSubmarine() {
    if (submarine == true) {
        return true;
    }
    else {
        return false;
    }
}

public boolean isBombed() {
    if (val==BOMBED) {
        return true;
    }
    else {
        return false;
    }
}

}